package database;

import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Stack;

public class BinarySearchTree <K extends Comparable<K>, V> implements Dictionary<K, V>{
	
	BinarySearchTreeEntry<K, V> root;
	private int size;

	public void clear() {
		root = null;
		
	}

	public V get(K key) throws NoSuchElementException {
		while (iterator().hasNext()) {
			if (root.getKey().equals(key)){
				return root.getValue();
			}
			iterator().next();
		}
		
		
		return null;
	}

	public boolean isEmpty() {
		return (root == null);
	}

	public void put(K key, V value) {
		// TODO Auto-generated method stub
		
	}

	public void remove(K key) throws NoSuchElementException {
		// TODO Auto-generated method stub
		
	}

	
	public int size() {
		return size;
	}

	
	public Iterator<DictionaryEntry<K, V>> iterator() {
		// TODO Auto-generated method stub
		return null;
	}
	
	private class BSTIterator implements Iterator<DictionaryEntry<K, V>> {
		private Stack <BinarySearchTreeEntry <K,V>> nodeStack;
		private BinarySearchTreeEntry<K, V> current;
		
		public boolean hasNext() {
			return !nodeStack.isEmpty();
		}

		
		public BinarySearchTreeEntry<K, V> next() {
			if (!(current == null)) {
				
			}
			
		}

		@Override
		public void remove() {
			// TODO Auto-generated method stub		
		}
		
	}

}
